import apiUrl from '../base'
import axios from '@/libs/axios'
const UnitProject = {
  //默认显示的项目
  userDefaultProject() {
    return axios.get(`${apiUrl.base}/v1/Project/getUserDefaultProject`, '')
  },
  // 项目列表
  projectGetAll(prames) {
    return axios.post(`${apiUrl.base}/v1/Project/selectAll`, prames)
  },
  // 单点工程懒加载树
  unitTreeGetAll(prames) {
    return axios.post(`${apiUrl.base}/v1/UnitEngineering/getAll`, prames)
  },
  // 单点工程列表
  unitTreeList(prames) {
    return axios.post(`${apiUrl.base}/v1/UnitEngineering/list`, prames)
  },
  // 单点工程详情
  unitTreeDetail(id) {
    return axios.get(`${apiUrl.base}/v1/UnitEngineering/detail/${id}`, '')
  },
  // 是否为控制工程
  getListByTypeCode(typeCode) {
    return axios.get(`${apiUrl.base}/v1/Dict/getListByTypeCode/${typeCode}`, '')
  },
  // 单点工程编辑
  unitTreeEdit(prames) {
    return axios.post(`${apiUrl.base}/v1/UnitEngineering/edit`, prames)
  },
  //单位工程删除
  unitTreeDelete(id) {
    return axios.delete(`${apiUrl.base}/v1/UnitEngineering/delete/${id}`, '')
  },
  // 单点工程新增
  unitTreeAdd(prames) {
    return axios.post(`${apiUrl.base}/v1/UnitEngineering/add`, prames)
  },
  //单位工程code码生成
  unitTreeCode(prames) {
    return axios.get(
      `${apiUrl.base}/v1/UnitEngineering/codeGenerate/${prames.projectId}/${prames.parentId}`,
      prames
    )
  }
}
export default UnitProject
